/*
    XTU OJ: 1461
    by: fifth_light
*/

#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

int main(void) {
    int t;
    scanf("%d", &t);
    for(int i = 0; i < t; i++) {
        int n;
        int64_t sum = 1;
        scanf("%d", &n);
        for (int j = 0; j < n; j++) {
            int64_t hair;
            scanf("%" SCNd64, &hair);
            sum *= hair;
        }
        printf("%" PRId64 "\n", sum);
    }
    return 0;
}
